import request from '@/config/axios'

export interface UsersVO {
  id: number
  username: string
  password: string
  nickname: string
  customLabel: string
  deptId: number
  postIds: string
  email: string
  mobile: string
  sex: number
  avatar: string
  status: number
  loginIp: string
  loginDate: Date
  userType: string
  agentId: number
  agentName: string
  remark: string
  warrantId: number
  warrantName: string
  censusRegister: string
  registeredHk: string
  age: number
  referrer: string
  isHome: string
  name: string
  openId: string
  wealthValue: number
}
export interface test  {
  userId: number,
  agentId: number,
  agentName: string,
  warrantId: number,
  warrantName: string
}
// 查询用户信息列表
export const getUsersPage = async (params) => {

  return await request.get({ url: `/hutai/client/page`, params })
}

//查询用户信息
export const getUserInformation = async (params) => {

  return await request.get({ url: `/hutai/client/getUserInfo?id=`+ params })
}

//查询用户贷款信息
export const getUserclient = async (params) => {
  return await request.get({ url: `/hutai/order/getMiniOrderUserInfo?id=`+ params })
}

// 业务员列表

export const getAgentList = async () => {
  return await request.get({ url: `/hutai/client/getAgentList` })
}

//获取当前用户
export const getUser = async () => {
  return await request.get({ url: `/hutai/userdb/getUser` })
}

// 分配业务员

export const putAgent = async (data:test) => {
  return await request.post({ url: `/hutai/client/allocationAgent`,data })
}

//取消
export const cancelAgent = async (data:test) => {
  return await request.post({ url: `/hutai/client/cancelAllocationAgent`,data })
}

//权证员列表
export const getWarrantList = async () => {

  return await request.get({ url: `/hutai/client/getWarrantList` })
}
// 分配权证员

export const putWarrant = async (data:test) => {
  return await request.post({ url: `/hutai/client/allocationWarrant`,data })
}

//取消
export const cancelWarran = async (data:test) => {
  return await request.post({ url: `/hutai/client/cancelAllocationWarrant`,data })
}

//获取贷款成功列表
export const getProcess = async () => {
  return await request.get({ url: `/hutai/process-record/get` })
}

// 新增用户信息
export const createUsers = async (data) => {
  return await request.post({ url: `/hutai/client/salesmanAddUser`, data })
}

//删除
export const deleteUser = async (id) => {
  return await request.post({ url: `/hutai/userdb/delete?id=`+id})
}

//禁用
export const forbiddenUser = async (id) => {
  return await request.post({ url: `/hutai/userdb/forbidden?id=`+id})
}

//导出
export const exportApplicationExcel = async (params) => {
  return await request.download({ url: `/hutai/client/export-excel`, params })
}
